package com.lyl.momanapp.activity;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;

import com.lyl.momanapp.R;
import com.lyl.momanapp.bean.URL;
import com.lyl.momanapp.util.view.MyBaseActivity;
import com.lyl.momanapp.util.view.PolygonImageview;

public class MainActivity extends MyBaseActivity {


    private PolygonImageview mOnePIV;
    private PolygonImageview mTwoPIV;
    private ImageView mThreeIV;
    private ImageView mFourIV;
    private ImageView mLogin;

    @Override
    public void initUI() {
        setContentView(R.layout.activity_main);
        mOnePIV = ((PolygonImageview) findViewById(R.id.home_page_piv_1));
        mTwoPIV = ((PolygonImageview) findViewById(R.id.home_page_piv_2));
        mThreeIV = ((ImageView) findViewById(R.id.home_page_iv_3));
        mFourIV = ((ImageView) findViewById(R.id.home_page_iv_4));
        mLogin = ((ImageView) findViewById(R.id.home_page_bom_iv));
    }

    @Override
    public void initData() {

    }

    @Override
    public void addListeners() {
        mOnePIV.setOnClickListener(this);
        mTwoPIV.setOnClickListener(this);
        mThreeIV.setOnClickListener(this);
        mFourIV.setOnClickListener(this);
        mLogin.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            //第一个按钮 画漫画
            case R.id.home_page_piv_1: {
                    startActivity(new Intent(MainActivity.this, OneActivity.class));
            }
            break;
            //第二个按钮 设计服装
            case R.id.home_page_piv_2: {
                   startActivity(new Intent(MainActivity.this,TwoActivity.class));
            }
            break;
            //第三个按钮 创秀
            case R.id.home_page_iv_3: {
                startActivity(new Intent(MainActivity.this,UserSeJiActivity.class));
            }
            break;
            //第四个按钮 空降上海
            case R.id.home_page_iv_4: {
                startActivity(new Intent(MainActivity.this,UserSeJiActivity.class));
            }
            break;
            case R.id.home_page_bom_iv:{
//                startActivity(new Intent(MainActivity.this, UserInFoActivity.class));
                    if (URL.Userlogin==null) {
                        startActivity(new Intent(MainActivity.this, UserLoginActivity.class));
                    }else {
                        startActivity(new Intent(MainActivity.this, UserInFoActivity.class));
                    }
            }break;
        }
    }
}
